<?php

namespace PHPSTORM_META
{

	registerArgumentsSet('bitrix_main_serviceLocator_codes',
		'exceptionHandler',
	);

	expectedArguments(\Bitrix\Main\DI\ServiceLocator::get(), 0, argumentsSet('bitrix_main_serviceLocator_codes'));

	override(\Bitrix\Main\DI\ServiceLocator::get(0), map([
		'exceptionHandler' => \Bitrix\Main\Diag\ExceptionHandler::class,
	]));

	exitPoint(\Bitrix\Main\Application::end());
	exitPoint(\Bitrix\Main\Application::terminate());
	exitPoint(\CAllMain::FinalActions());
	exitPoint(\LocalRedirect());

	registerArgumentsSet(
		'bitrix_main_modules_list',
		'abtest',
		'advertising',
		'assistant',
		'b24connector',
		'b24network',
		'bitrix24',
		'bitrixcloud',
		'bitrix.eshop',
		'bitrix.giphybot',
		'bitrix.propertiesbot',
		'bitrix.sitecommunity',
		'bitrix.sitecorporate',
		'bitrix.siteinfoportal',
		'bitrix.sitepersonal',
		'bizcard',
		'bizcardcontroller',
		'bizproc',
		'bizprocdesigner',
		'blog',
		'botcontroller',
		'bxmobile',
		'bxtest',
		'calendar',
		'cases',
		'catalog',
		'clouds',
		'cluster',
		'controller',
		'conversion',
		'crm',
		'crmmobile',
		'currency',
		'dav',
		'disk',
		'documentgenerator',
		'documentproxy',
		'extranet',
		'faceid',
		'faceidcontroller',
		'fileman',
		'form',
		'forum',
		'highloadblock',
		'iblock',
		'idea',
		'im',
		'imbot',
		'imconnector',
		'imconnectorserver',
		'imopenlines',
		'immobile',
		'intranet',
		'landing',
		'ldap',
		'learning',
		'lists',
		'location',
		'mail',
		'mailcontroller',
		'main',
		'meeting',
		'messageservice',
		'microservice',
		'ml',
		'mlserver',
		'mobile',
		'mobileapp',
		'notifications',
		'notificationservice',
		'oauth',
		'osmgateway',
		'perfcheck',
		'perfmon',
		'photogallery',
		'propertiesservice',
		'pull',
		'queue',
		'recyclebin',
		'replica',
		'replicaserver',
		'report',
		'rest',
		'rpa',
		'sale',
		'salescenter',
		'saleservices',
		'scale',
		'search',
		'security',
		'securityscanner',
		'sender',
		'seo',
		'seoproxy',
		'socialnetwork',
		'socialservices',
		'sqs',
		'statistic',
		'storeassist',
		'subscribe',
		'support',
		'tasks',
		'tasksmobile',
		'timeman',
		'transformer',
		'transformercontroller',
		'translate',
		'ui',
		'update',
		'updateserver',
		'updateserverlight',
		'video',
		'videomost',
		'videoport',
		'vote',
		'voximplant',
		'voximplantadmin',
		'voximplantcontroller',
		'webdav',
		'webservice',
		'wiki',
		'workflow',
		'xdimport',
		'xmpp',
		'zoomcontroller',
	);
	expectedArguments(\CModule::IncludeModule(), 0, argumentsSet('bitrix_main_modules_list'));
	expectedArguments(\Bitrix\Main\Loader::includeModule(), 0, argumentsSet('bitrix_main_modules_list'));
	expectedArguments(\Bitrix\Main\Loader::requireModule(), 0, argumentsSet('bitrix_main_modules_list'));
	expectedArguments(\Bitrix\Main\ModuleManager::isModuleInstalled(), 0, argumentsSet('bitrix_main_modules_list'));
	expectedArguments(\Bitrix\Main\Config\Option::get(), 0, argumentsSet('bitrix_main_modules_list'));
	expectedArguments(\Bitrix\Main\Config\Option::set(), 0, argumentsSet('bitrix_main_modules_list'));
	expectedArguments(\Bitrix\Main\Config\Configuration::getInstance(), 0, argumentsSet('bitrix_main_modules_list'));
}